package com.allwees.bs.module.mms.rest;


import com.allwees.bs.core.modelbase.vo.R;
import com.allwees.bs.module.mms.service.RetailerStatisticsService;
import com.allwees.bs.module.mms.vo.RetailerStatisticsVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/backstage/api/mms/statistic")
public class RetailerStatisticsApi {

    @Autowired
    private RetailerStatisticsService retailerStatisticsService;

    @GetMapping("/retailer")
    public R retailerStatistics() {
        RetailerStatisticsVo retailerStatisticsVo = new RetailerStatisticsVo()
                .setYesterdayNewNum(retailerStatisticsService.findYesterdayNewNum())//昨日新增入驻
                .setTotalRetailerNum(retailerStatisticsService.findTotalRetailerNum());//累计入驻
                //.setActiveRetailerNum(retailerStatisticsService.findActiveRetailerNum());//活跃商户数

        return R.ok(retailerStatisticsVo);
    }
}
